// Initialize your app
var myApp = new Framework7({
    material: true
});

// Export selectors engine
var $$ = Dom7;

// Add view
var mainView = myApp.addView('.view-main', {
    // Because we use fixed-through navbar we can enable dynamic navbar
    dynamicNavbar: false
});


// $$('#btn_msg').on('click', function () {
function sub_msg(){
  // myApp.alert('Tap hold fired!');
  var name=$("#name").val();
  var email=$("#email").val();
  var phone=$("#phone").val();
  var message=$("#message").val();
  if(name==""){
    alert("请输联系人");return;
  }
   if(email==""){
    alert("请输联系邮箱");return;
  }
   if(phone==""){
    alert("请输联系手机");return;
  }
   if(message==""||message.length<10){
    alert("留言长度不足");return;
  }
  console.log("aaa");
      var storedData = $('#frm').serialize();
      console.log(storedData);   
  if(storedData) {
    $.ajax({
   type: "POST",
   url: "/msg/addMessage",
   data: storedData,
   dataType:"json",
   success: function(json){
        if(json.code==0){
            $("#message").val("");
              myApp.addNotification({
                message: json.msg,
                button: {
                    text: '关闭',
                    color: 'yellow'
                }

            });
        }
       }
    });
    }
  
};
/*=== 默认为 standalone ===*/
var myPhotoBrowserStandalone = myApp.photoBrowser({
    photos : [
        'img/weixin/1/1.png',
        'img/weixin/1/2.png',
        'img/weixin/1/3.png',
    ]
});

//点击时打开图片浏览器
$$('#sys').on('click', function () {
    myPhotoBrowserStandalone.open();
});
var dwmobile = myApp.photoBrowser({
    photos : [
        'img/pcsystem/1/1.jpg',
        'img/pcsystem/1/2.jpg',
        'img/pcsystem/1/3.jpg',
        'img/pcsystem/1/4.jpg',
        'img/pcsystem/1/5.jpg',
        'img/pcsystem/1/6.jpg'
    ]
});
$$('#dwmobile').on('click', function () {
    dwmobile.open();
});
var dwadmin = myApp.photoBrowser({
    photos : [
        'img/pcsystem/2/1.png',
        'img/pcsystem/2/2.jpg',
        'img/pcsystem/2/3.png',
        'img/pcsystem/2/4.jpg',
        'img/pcsystem/2/5.jpg'

    ]
});
$$('#dwadmin').on('click', function () {
    dwadmin.open();
});

var xrxs = myApp.photoBrowser({
    photos : [
        'img/pcsystem/3/1.png',
        'img/pcsystem/3/2.png',
        'img/pcsystem/3/3.png',
        'img/pcsystem/3/4.png',
        'img/pcsystem/3/5.png',
        'img/pcsystem/3/6.png'

    ]
});
$$('#xrxs').on('click', function () {
    xrxs.open();
});

var ywl = myApp.photoBrowser({
    photos : [
        'img/android/1/1.jpg',
        'img/android/1/2.jpg',
        'img/android/1/3.jpg',
        'img/android/1/4.jpg',
        'img/android/1/5.jpg'

    ]
});
$$('#ywl').on('click', function () {
    ywl.open();
});

var ckt = myApp.photoBrowser({
    photos : [
        'img/android/2/1.jpg',
        'img/android/2/2.jpg',
        'img/android/2/3.jpg',
        'img/android/2/4.jpg',
        'img/android/2/5.jpg'

    ]
});
$$('#ckt').on('click', function () {
    ckt.open();
});

var uxp = myApp.photoBrowser({
    photos : [
        'img/android/3/1.png',
        'img/android/3/2.png',
        'img/android/3/3.png'

    ]
});
$$('#uxp').on('click', function () {
    uxp.open();
});


var zsdn = myApp.photoBrowser({
    photos : [
        'img/android/4/1.jpeg',
        'img/android/4/2.jpeg',
        'img/android/4/3.jpeg',
        'img/android/4/4.jpeg',
        'img/android/4/5.jpeg'

    ]
});
$$('#zsdn').on('click', function () {
    zsdn.open();
});

var ssds = myApp.photoBrowser({
    photos : [
        'img/android/5/1.jpeg',
        'img/android/5/2.jpeg',
        'img/android/5/3.jpeg'

    ]
});
$$('#ssds').on('click', function () {
    ssds.open();
});

var skill = myApp.photoBrowser({
    photos : [
        'img/qqrobot/1/1.png',
        'img/qqrobot/1/2.png',
        'img/qqrobot/1/3.png',
        'img/qqrobot/1/4.png',
        'img/qqrobot/1/5.png',
        'img/qqrobot/1/6.png'

    ]
});
$('#skill').on('click', function () {
    skill.open();
});

 var mySwiper = myApp.swiper('.swiper-container', {
    pagination:'.swiper-pagination',
    spaceBetween: 100 // 100px between slides
  });
function showskill(){
    skill.open();
}
function showdwmobile(){
    dwmobile.open();
}
function showdwadmin(){
    dwadmin.open();
}
function showxrxs(){
    xrxs.open();
}
function showywl(){
    ywl.open();
}
function showckt(){
    ckt.open();
}
function showuxp(){
    uxp.open();
}
function showzsdn(){
    zsdn.open();
}

function showssds(){
    ssds.open();
}

function showsys(){
    myPhotoBrowserStandalone.open();
}
// $$('.item-link').on('click', function () {
//   myApp.alert('Tap hold fired!');
// });
// Callbacks to run specific code for specific pages, for example for About page:
// myApp.onPageInit('about', function (page) {
//     // run createContentPage func after link was clicked
//     $$('.create-page').on('click', function () {
//         createContentPage();
//     });
// });

// // Generate dynamic page
// var dynamicPageIndex = 0;
// function createContentPage() {
// 	mainView.router.loadContent(
//         '<!-- Top Navbar-->' +
//         '<div class="navbar">' +
//         '  <div class="navbar-inner">' +
//         '    <div class="left"><a href="#" class="back link"><i class="icon icon-back"></i><span>Back</span></a></div>' +
//         '    <div class="center sliding">Dynamic Page ' + (++dynamicPageIndex) + '</div>' +
//         '  </div>' +
//         '</div>' +
//         '<div class="pages">' +
//         '  <!-- Page, data-page contains page name-->' +
//         '  <div data-page="dynamic-pages" class="page">' +
//         '    <!-- Scrollable page content-->' +
//         '    <div class="page-content">' +
//         '      <div class="content-block">' +
//         '        <div class="content-block-inner">' +
//         '          <p>Here is a dynamic page created on ' + new Date() + ' !</p>' +
//         '          <p>Go <a href="#" class="back">back</a> or go to <a href="services.html">Services</a>.</p>' +
//         '        </div>' +
//         '      </div>' +
//         '    </div>' +
//         '  </div>' +
//         '</div>'
//     );
// 	return;
// }